<?php
/**
 * The main template file.
 *
 * This is the most generic template file in a WordPress theme
 * and one of the two required files for a theme (the other being style.css).
 * It is used to display a page when nothing more specific matches a query.
 * E.g., it puts together the home page when no home.php file exists.
 * Learn more: http://codex.wordpress.org/Template_Hierarchy
 *
 */
 
// define current page: will determine which javascript to load and what styles
$CURRENT_PAGE = 'index';

get_header(); 

$blog_ID = get_category_by_slug('blog')->term_id;
  
?>

<div id="wrapper_main" class="grid_24">

	<div id="editorial" class="grid_10 suffix_1 alpha">
		<?php
			// Get latest post on the blog
			$args = array_merge( $wp_query->query, array( 'category__in' => $blog_ID, 'posts_per_page' => 1 ) );
			
			query_posts( $args );
		?>
		
		<?php if ( ! have_posts() ) : ?>
		
			<p><?php _e('No content available yet!.', ns_text_domaine); ?></p>
		
		<?php else : ?>

			<?php while ( have_posts() ) : the_post(); ?>
			
			<h1 class="<?php if ( ns_is_there_tz_chars( get_the_title() ) ) echo 'tz';?>"><?php the_title(); ?></h1>
			
			<span class="<?php if ( ns_is_there_tz_chars( get_the_content() ) ) echo 'tz';?>"><?php the_content(); ?></span>
			
			<p><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">#</a></p>
			
			<?php endwhile; 
		endif;
			
			// Reset Query
			wp_reset_query();
		?>
	</div>
	
	<?php get_template_part( 'tools' ); ?>
	
	
	
	<?php get_sidebar(); ?>
	
</div>
<!--End #wrapper_main-->

<?php get_footer(); ?>